<!DOCTYPE html>
<html ng-app="addUserCtrl">

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/login.css" />
    <link rel="stylesheet" type="text/css" href="css/zhuce.css" />

    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" href="css/bootstrap.css">
    <script type="text/javascript" src="js/jquery-2.2.3.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.js"></script>
    <!--交互使用文件-->
    <link rel="stylesheet" type="text/css" href="css/jNotify.jquery.css" />
    <script type="text/javascript" src="js/jquery-3.1.1.min.js" ></script>
    <script type="text/javascript" src="js/angular-1.5.6.js" ></script>
    <script type="text/javascript" src="js/controller.js" ></script>
    <script type="text/javascript" src="js/jNotify.jquery.js"></script>
</head>

<body class="login " mycollectionplug="bind" ng-controller="addUser">

<div class="login_m ">

    <div class="login_logo"><img src="img/logo.png" width="50em" height="50em">
        <h3>圣洁雅江</h3></div>
    <div class="login_boder">

        <div class="login_padding" id="login_model">
            <h2>昵称</h2>
            <label>
                <input type="text" id="nicheng" class="txt_input txt_input2" placeholder="昵称" ng-model="user.name"/>
            </label>
            <h2>用户名</h2>
            <label>
                <input type="text" id="username" class="txt_input txt_input2" placeholder="用户名" ng-model="user.username"/>
            </label>
            <div id="txone" class="tixing"></div>
            <h2>手机号</h2>
            <label>
                <input type="text" id="phone" class="txt_input txt_input2" placeholder="请输入手机号" ng-model="user.phone"/>
            </label>
            <div id="txphone" class="tixing"></div>
            <h2>密码</h2>
            <label>
                <input type="password" name="textfield2" id="userpwd" class="txt_input" placeholder="请输入六位数密码" ng-model="user.password" />
            </label>
            <div id="txtwo" class="tixing"></div>
            <h2>确定密码</h2>
            <label>
                <input type="password" name="textfield2" id="userpwd2" class="txt_input" placeholder="******"/>
            </label>
            <div id="txthere" class="tixing"></div>

            <p class="forgot">
                <a id="iforget" href="login.html">已有账号，去登录</a>
            </p>
            <div class="rem_sub">

                <label>
                    <input type="submit" class="sub_button" name="button" id="button" value="注册" style="opacity: 0.7;" ng-click="addUser()">
                </label>
            </div>
        </div>
        <!--login_padding  Sign up end-->
    </div>
    <!--login_boder end-->
</div>
<!--login_m end-->
<script>
    var username = document.getElementById("username");
    var phone = document.getElementById("phone");

    var userpwd = document.getElementById("userpwd");
    var userpwd2 = document.getElementById("userpwd2");
    var txone = document.getElementById("txone");
    var txtwo = document.getElementById("txtwo");
    var txthere = document.getElementById("txthere");
    var txphone = document.getElementById("txphone");
    var myreg=/^[1][3,4,5,7,8,9][0-9]{9}$/;

    username.onmouseout = function() {
        if(username.value == "") {
            txone.innerHTML = "用户名为空";
        } else {
            txone.innerHTML = "";
        }
    };

    phone.onmouseout = function() {
        if(!myreg.test(phone.value)) {
            txphone.innerHTML = "请输入正确的手机号";
        } else {
            txphone.innerHTML = "";
        }
    };

    userpwd.onmouseout = function() {
        //		console.log(userpwd.value.length);
        if(userpwd.value.length != 6) {
            txtwo.innerHTML = "密码格式不对";
        } else {
            txtwo.innerHTML = "";
        }
    };
    userpwd2.onmouseout = function() {
        if(userpwd.value != userpwd2.value) {
            txthere.innerHTML = "两次密码不一致";
        } else {
            txthere.innerHTML = "";
        }
    }
</script>
</body>

</html>